<template>
  <div id="map04"></div>
</template>

<script>
    export default {
        name: "UserAdminMyData-map04",
        data(){
            return{
                baseURL:'http://localhost:8081/userAdmin/getUserAllReplyCount',
            }
        },
        mounted(){
            this.axios.post(this.baseURL).then(res=>{
                this.$echarts.init(document.getElementById('map04')).setOption({
                    title:{
                        text:this.$t('userAdmin.data.map04.title'),
                        left:"50px"
                    },
                    tooltip : {
                        trigger: 'item',
                    },
                    legend: {
                        top: "40px",
                        data: this.$t('userAdmin.data.map04.legendData'),

                    },
                    series : [
                        {
                            top: "50px",
                            type:'pie',
                            data:[
                                {
                                    value:res.data[0].errorReplyCount, //定义所占比例，总的为100
                                    name:this.$t('userAdmin.data.map04.seriesData')[0], //名称
                                },
                                {
                                    value:res.data[0].questionReplyCount,
                                    name:this.$t('userAdmin.data.map04.seriesData')[1],
                                },
                                {
                                    value:res.data[0].likeBlinkCount,
                                    name:this.$t('userAdmin.data.map04.seriesData')[2],
                                }
                            ],
                        }
                    ]
                })
            }).catch(
                exception=>{
                    console.log(exception)
                }
            )
        }
    }
</script>

<style scoped>
  #map04{
    width: 930px;
    height: 365px;
    position: absolute;
    top: 120px;
  }
</style>
